export default {
   // 判断审核状态
   isStatus(status) {   
     if(status == 5) {
       return '草稿'
     }else if(status == 1) {
       return '审核通过'
     }else if(status == 2) {
       return '驳回修改'
     }else if(status == 3) {
       return '后台下架'
     }else if(status == 4) {
       return '待审核中'
     }
   },

   getdates(data) {
     let time = new Date(data*1000);
     let n = time.getFullYear();
     let y = time.getMonth() + 1;
     let r = time.getDate();
     let h = time.getHours();
     let i = time.getMinutes();
     let s = time.getSeconds();
      
     return `${n}-${y}-${r} ${h}:${i}:${s}`;    
    },
    codeAddress({address,success}) {
      var geocoder = new qq.maps.Geocoder();
      console.log(address)
      //对指定地址进行解析
      geocoder.getLocation(address);
      //设置服务请求成功的回调函数
      geocoder.setComplete((res) => {
          success(res.detail)
          console.log(res)
      });
      //若服务请求失败，则运行以下函数
      geocoder.setError(function() {
        alert("出错了，请输入正确的地址！！！");
      });
    }
} 

